package com.ruiysoft.entity.order;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author liyahui
 * @since 2018-11-25
 */
@TableName("order_main")
public class OrderMain extends Model<OrderMain> {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("order_no")
    private String orderNo;

    @TableField("transaction_no")
    private String transactionNo;

    @TableField("shop_id")
    private Long shopId;

    @TableField("user_id")
    private Long userId;

    @TableField("open_id")
    private String openId;

    /**
     * 1 用户常规订单
     * 2 系统生成换货单
     * 3 店铺生成订单
     */
    private Integer type;

    /**
     * 1 常规订单
     * 2 虚拟物品订单
     */
    @TableField("biz_type")
    private Integer bizType;

    /**
     * 1 订单生成 待用户确认
     * 2 待用户付款
     * 3 用户已付款 待平台确认
     * 4 平台已确认 待商铺确认
     * 5 商铺确认付款 待发货
     * 6 已发货 待确认收货
     * 7 已收货
     * 11 申请换货 待商铺确认
     * 12 商铺确认换货
     * 21 申请退货 待商铺确认
     * 22 商铺确认退货 待退款
     * 23 已退款
     * 97 订单取消
     * 98 订单关闭
     * 99 订单完结
     */
    private Integer status;

    /**
     * 分销结算状态 0 不可结算 1 待结算 2 已结算
     */
    @TableField("distribution_status")
    private Integer distributionStatus;

    @TableField("create_time")
    private Date createTime;

    @TableField("cancel_time")
    private Date cancelTime;

    @TableField("pay_time")
    private Date payTime;
    /**
     * 1 微信
     * 2 虚拟币
     * 9 混合
     */
    @TableField("pay_type")
    private Integer payType;

    private Long creator;

    /**
     * 总金额
     */
    @TableField("total_amount")
    private Long totalAmount;
    /**
     * 应收现金金额
     */
    @TableField("receivable_amount")
    private Long receivableAmount;

    /**
     * 实际收到的金额
     */
    @TableField("collected_amount")
    private Long collectedAmount;

    /**
     * 虚拟币总额
     */
    @TableField("total_virtual_coin")
    private Long receivableVirtualCoin;

    /**
     * 实际收到的虚拟币总额
     */
    @TableField("collected_virtual_coin")
    private Long collectedVirtualCoin;

    /**
     * 商品参考价值总额：用于计算运费
     */
    @TableField("mdse_total_amount")
    private Long mdseTotalAmount;

    /**
     * 商品应收现金总额
     */
    @TableField("mdse_receivable_amount")
    private Long mdseReceivableAmount;

    /**
     * 1 快递
     * 2 自取
     */
    @TableField("distribution_mode")
    private Integer distributionMode;

    @TableField("freight")
    private Long freight;

    @TableField("final_sign_time")
    private Date finalSignTime;

    @TableField("remark")
    private String remark;

    @TableField("del_flag")
    private Boolean delFlag;

    public Long getId() {
        return id;
    }

    public OrderMain setId(Long id) {
        this.id = id;
        return this;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public OrderMain setOrderNo(String orderNo) {
        this.orderNo = orderNo;
        return this;
    }

    public String getTransactionNo() {
        return transactionNo;
    }

    public OrderMain setTransactionNo(String transactionNo) {
        this.transactionNo = transactionNo;
        return this;
    }

    public Long getShopId() {
        return shopId;
    }

    public OrderMain setShopId(Long shopId) {
        this.shopId = shopId;
        return this;
    }

    public Long getUserId() {
        return userId;
    }

    public OrderMain setUserId(Long userId) {
        this.userId = userId;
        return this;
    }

    public String getOpenId() {
        return openId;
    }

    public OrderMain setOpenId(String openId) {
        this.openId = openId;
        return this;
    }

    public Integer getType() {
        return type;
    }

    public OrderMain setType(Integer type) {
        this.type = type;
        return this;
    }

    public Integer getBizType() {
        return bizType;
    }

    public OrderMain setBizType(Integer bizType) {
        this.bizType = bizType;
        return this;
    }

    public Integer getStatus() {
        return status;
    }

    public OrderMain setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public Integer getDistributionStatus() {
        return distributionStatus;
    }

    public OrderMain setDistributionStatus(Integer distributionStatus) {
        this.distributionStatus = distributionStatus;
        return this;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public OrderMain setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public Date getCancelTime() {
        return cancelTime;
    }

    public OrderMain setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
        return this;
    }

    public Date getPayTime() {
        return payTime;
    }

    public OrderMain setPayTime(Date payTime) {
        this.payTime = payTime;
        return this;
    }

    public Integer getPayType() {
        return payType;
    }

    public OrderMain setPayType(Integer payType) {
        this.payType = payType;
        return this;
    }

    public Long getCreator() {
        return creator;
    }

    public OrderMain setCreator(Long creator) {
        this.creator = creator;
        return this;
    }

    public Long getTotalAmount() {
        return totalAmount;
    }

    public OrderMain setTotalAmount(Long totalAmount) {
        this.totalAmount = totalAmount;
        return this;
    }

    public Long getReceivableAmount() {
        return receivableAmount;
    }

    public OrderMain setReceivableAmount(Long receivableAmount) {
        this.receivableAmount = receivableAmount;
        return this;
    }

    public Long getCollectedAmount() {
        return collectedAmount;
    }

    public OrderMain setCollectedAmount(Long collectedAmount) {
        this.collectedAmount = collectedAmount;
        return this;
    }

    public Long getReceivableVirtualCoin() {
        return receivableVirtualCoin;
    }

    public void setReceivableVirtualCoin(Long receivableVirtualCoin) {
        this.receivableVirtualCoin = receivableVirtualCoin;
    }

    public Long getCollectedVirtualCoin() {
        return collectedVirtualCoin;
    }

    public void setCollectedVirtualCoin(Long collectedVirtualCoin) {
        this.collectedVirtualCoin = collectedVirtualCoin;
    }

    public Long getMdseTotalAmount() {
        return mdseTotalAmount;
    }

    public void setMdseTotalAmount(Long mdseTotalAmount) {
        this.mdseTotalAmount = mdseTotalAmount;
    }

    public Long getMdseReceivableAmount() {
        return mdseReceivableAmount;
    }

    public void setMdseReceivableAmount(Long mdseReceivableAmount) {
        this.mdseReceivableAmount = mdseReceivableAmount;
    }

    public Integer getDistributionMode() {
        return distributionMode;
    }

    public OrderMain setDistributionMode(Integer distributionMode) {
        this.distributionMode = distributionMode;
        return this;
    }

    public Long getFreight() {
        return freight;
    }

    public OrderMain setFreight(Long freight) {
        this.freight = freight;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public OrderMain setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    public Boolean getDelFlag() {
        return delFlag;
    }

    public OrderMain setDelFlag(Boolean delFlag) {
        this.delFlag = delFlag;
        return this;
    }

    public Date getFinalSignTime() {
        return finalSignTime;
    }

    public void setFinalSignTime(Date finalSignTime) {
        this.finalSignTime = finalSignTime;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "OrderMain{" +
                "id=" + id +
                ", orderNo=" + orderNo +
                ", transactionNo=" + transactionNo +
                ", shopId=" + shopId +
                ", userId=" + userId +
                ", openId=" + openId +
                ", type=" + type +
                ", bizType=" + bizType +
                ", status=" + status +
                ", distributionStatus=" + distributionStatus +
                ", createTime=" + createTime +
                ", cancelTime=" + cancelTime +
                ", payTime=" + payTime +
                ", payType=" + payType +
                ", creator=" + creator +
                ", totalAmount=" + totalAmount +
                ", receivableAmount=" + receivableAmount +
                ", collectedAmount=" + collectedAmount +
                ", distributionMode=" + distributionMode +
                ", freight=" + freight +
                ", remark=" + remark +
                ", delFlag=" + delFlag +
                "}";
    }
}
